﻿using DomainModel;
using Repository.Abstract;

namespace Repository.NHibernate
{
    public class GroupRepository : Repository<Group>, IGroupRepository
    {
        public Group TeacherIsCurator(User teacher)
        {
            return Session.QueryOver<Group>().Where(g => g.Curator.Id == teacher.Id).SingleOrDefault();
        }

        public Group StudentIsPraepostor(User student)
        {
            return Session.QueryOver<Group>().Where(g => g.Praepostor.Id == student.Id).SingleOrDefault();
        }
    }
}